/* This code is inspired from a developement of Nikola Malovic
 * check http://blog.vuscode.com/malovicn/archive/2007/10/25/model-view-presenter-mvp-design-pattern-close-look-part-1-passive-view.aspx for more information
*/

using Microsoft.SharePoint;
namespace SharePointOfView.Patterns.MVP
{
    public abstract class Presenter<TView> : IPresenter
    {
        public TView View { get; set; }
        public SPContext SPContext { get; set; }

        #region IPresenter Members
        
        object IPresenter.View
        {
            get { return View; }
            set { View = (TView) value; }
        }

        SPContext IPresenter.SPContext
        {
            get { return SPContext; }
            set { SPContext = value; }
        }

        public virtual void OnViewInitialized()
        {
            /* do nothing*/
        }

        public virtual void OnViewLoaded()
        {
            /* do nothing*/
        }

        #endregion
    }
}